home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / ARMTEX / BASE / AddToPath / !ReadMe next >
Text File  |  1996-11-18  |  2KB  |  61 lines

  1. AddToPath v1.00, Copyright (C) Olly Betts 1994,1996
  2.  
  3. Provided "as is".  I take no responsibility for any problems, or side
  4. effects.  Freely distributable with no restrictions, so you may use it
  5. in the !Run or !Boot file of any application.  It is 256 bytes in size,
  6. so won't take up much room.  Please make it clear if you have modified
  7. a version and are distributing it.
  8.  
  9. Syntax:  AddToPath <path variable> <path element>
  10.  
  11. Eg.  *AddToPath Run$Path <UnixBin$Dir>.
  12.  
  13. Adds <path element> to <path variable> if it isn't already in there. 
  14. Matching is case sensitive (case may be significant, e.g. on NFS), so be
  15. consistent with your capitalisation.  If the element needs to be added,
  16. it is appended to the end of the path variable, separated by a comma.
  17. Spaces are removed from the existing path variable to try to keep the
  18. length down.
  19.  
  20. Put simply, "AddToPath X$Path Element" does:
  21.  
  22. *SetMacro X$Path <X$Path>,NewElement
  23.  
  24. except that X$Path isn't altered if it already contains NewElement.
  25.  
  26. To add more than one element to a path, call AddToPath twice -- if you
  27. ask it to add something with a comma in, it will *always* get added.
  28.  
  29. If AddToPath alters the path variable it will turn it into a macro (since
  30. this is usually what is wanted, and it helps keep the path variable short).
  31. Incidentally, AddToPath will cope if some joker has set the path variable
  32. to be a numeric variable.
  33.  
  34. If the path variable grows longer than 1024 characters (the size of the
  35. workspace RISC OS gives utilities) then AddToPath will fail (possibly not
  36. very cleanly).  For most uses this is probably not a problem.  If it is
  37. for you, the source code is provided (send me a copy too).
  38.  
  39. Hope you find it useful,
  40. Olly
  41. 1996.11.18
  42.  
  43. Internet e-mail:
  44. olly@muscat.co.uk (NB new address as of November 1996)
  45.  
  46. Post:
  47. Olly Betts,
  48. 24 Morgans Road,
  49. Hertford,
  50. Herts,
  51. SG13 8BS
  52.  
  53. Revision History:
  54.  
  55. 1.00 Jumped version number since I've had no bug reports in 2 years
  56.      Now prints version number if run with less than 2 arguments
  57.  
  58. 0.02 Syntax altered to *AddToPath Run$Path <UnixBin$Dir>.
  59.  
  60. 0.01 Original version which only worked on Run$Path
  61.